num = int(input())
hundreds = num // 100
tens = num % 100 // 10
ones = num % 10
newNum = ones * 100 + tens * 10 + hundreds
print(newNum)